package net.showcal.api.request.mobile;


import com.alibaba.fastjson.JSON;
import net.showcal.api.ApiRuleException;
import net.showcal.api.XiniuRequest;
import net.showcal.api.contract.SortTypeEnum;
import net.showcal.api.internal.util.RequestCheckUtils;
import net.showcal.api.internal.util.XiniuHashMap;
import net.showcal.api.response.mobile.FoodFindResponse;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* <p/>
* <pre>
 * ***************************************************************
 *  Copyright (c) 2014 –苏州犀牛网络科技有限公司
    *  Title: com.xiniunet.thermalcontrol.helper.ThermalcontrolHelperImpl
    *  Description: thermalcontrol Request
    *  @since
    *  @author 顾志雄
    * ***************************************************************
 * </pre>
*/
public class FoodFindRequest implements XiniuRequest<FoodFindResponse> {
    private XiniuHashMap udfParams = new XiniuHashMap();
    /**
     * 获取API名称
     */
    @Override
    public String getApiMethodName() {
        return "thermalcontrol.food.find";
    }

    /**
     * 主键
     */
    private Long id;
    /**
     * 食物名称
     */
    private String name;
    /**
     * 食物重量
     */
    private Double weight;
    /**
     * 食物热量
     */
    private Double heat;
    /**
     * 单位热量
     */
    private Double unitheat;
    /**
     * 蛋白质(克) 单位(克)
     */
    private Double protein;
    /**
     * 脂肪（克）
     */
    private Double fat;
    /**
     * 碳水化合物（克）
     */
    private Double carbohydrate;
    /**
     * 膳食纤维（克）
     */
    private Double df;
    /**
     * 条形码
     */
    private String barCode;
    /**
     * 品牌
     */
    private String brand;
    /**
     * 食物交换份克数(克)
     */
    private Double foodExchange;
    /**
     * 单位食用克数(克)
     */
    private Double edubleUnit;
    /**
     * 食物单位
     */
    private String unit;
    /**
     * 每单位重量
     */
    private Double unitWeight;
    /**
     * 食物大类
     */
    private Long foodLargeCategory;
    /**
     * 食物分类
     */
    private Long foodCategoryId;
    /**
     * 减肥是否推荐
     */
    private Integer isLose;
    /**
     * 增肌是否推荐
     */
    private Integer isAddMuscle;
    /**
     * 是否常见
     */
    private Integer isCommon;
    /**
     * 来源ID
     */
    private Long sourceId;
    /**
     * 菜谱ID
     */
    private Long menuId;
    /**
     * 菜谱类别
     */
    private Integer menuCategory;
    /**
     * 是否有效
     */
    private Boolean isActive;
    /**
     * 生效日期
     */
    private Date activeDate;
    /**
     * 生效人
     */
    private String activeUser;
    /**
     * 当前页数
     */
    private int pageNumber;
    /**
     * 分页大小
     */
    private int pageSize;
    /**
     * 排序列
     */
    private List<String> sortKey;
    /**
     * 排序方式
     */
    private SortTypeEnum sortType;

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id=id;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name=name;
    }

    public Double getWeight(){
        return weight;
    }

    public void setWeight(Double weight){
        this.weight=weight;
    }

    public Double getHeat(){
        return heat;
    }

    public void setHeat(Double heat){
        this.heat=heat;
    }

    public Double getUnitheat(){
        return unitheat;
    }

    public void setUnitheat(Double unitheat){
        this.unitheat=unitheat;
    }

    public Double getProtein(){
        return protein;
    }

    public void setProtein(Double protein){
        this.protein=protein;
    }

    public Double getFat(){
        return fat;
    }

    public void setFat(Double fat){
        this.fat=fat;
    }

    public Double getCarbohydrate(){
        return carbohydrate;
    }

    public void setCarbohydrate(Double carbohydrate){
        this.carbohydrate=carbohydrate;
    }

    public Double getDf(){
        return df;
    }

    public void setDf(Double df){
        this.df=df;
    }

    public String getBarCode(){
        return barCode;
    }

    public void setBarCode(String barCode){
        this.barCode=barCode;
    }

    public String getBrand(){
        return brand;
    }

    public void setBrand(String brand){
        this.brand=brand;
    }

    public Double getFoodExchange(){
        return foodExchange;
    }

    public void setFoodExchange(Double foodExchange){
        this.foodExchange=foodExchange;
    }

    public Double getEdubleUnit(){
        return edubleUnit;
    }

    public void setEdubleUnit(Double edubleUnit){
        this.edubleUnit=edubleUnit;
    }

    public String getUnit(){
        return unit;
    }

    public void setUnit(String unit){
        this.unit=unit;
    }

    public Double getUnitWeight(){
        return unitWeight;
    }

    public void setUnitWeight(Double unitWeight){
        this.unitWeight=unitWeight;
    }

    public Long getFoodLargeCategory(){
        return foodLargeCategory;
    }

    public void setFoodLargeCategory(Long foodLargeCategory){
        this.foodLargeCategory=foodLargeCategory;
    }

    public Long getFoodCategoryId(){
        return foodCategoryId;
    }

    public void setFoodCategoryId(Long foodCategoryId){
        this.foodCategoryId=foodCategoryId;
    }

    public Integer getIsLose(){
        return isLose;
    }

    public void setIsLose(Integer isLose){
        this.isLose=isLose;
    }

    public Integer getIsAddMuscle(){
        return isAddMuscle;
    }

    public void setIsAddMuscle(Integer isAddMuscle){
        this.isAddMuscle=isAddMuscle;
    }

    public Integer getIsCommon(){
        return isCommon;
    }

    public void setIsCommon(Integer isCommon){
        this.isCommon=isCommon;
    }

    public Long getSourceId(){
        return sourceId;
    }

    public void setSourceId(Long sourceId){
        this.sourceId=sourceId;
    }

    public Long getMenuId(){
        return menuId;
    }

    public void setMenuId(Long menuId){
        this.menuId=menuId;
    }

    public Integer getMenuCategory(){
        return menuCategory;
    }

    public void setMenuCategory(Integer menuCategory){
        this.menuCategory=menuCategory;
    }

    public Boolean getIsActive(){
        return isActive;
    }

    public void setIsActive(Boolean isActive){
        this.isActive=isActive;
    }

    public Date getActiveDate(){
        return activeDate;
    }

    public void setActiveDate(Date activeDate){
        this.activeDate=activeDate;
    }

    public String getActiveUser(){
        return activeUser;
    }

    public void setActiveUser(String activeUser){
        this.activeUser=activeUser;
    }

    public int getPageNumber(){
        return pageNumber;
    }

    public void setPageNumber(int pageNumber){
        this.pageNumber=pageNumber;
    }

    public int getPageSize(){
        return pageSize;
    }

    public void setPageSize(int pageSize){
        this.pageSize=pageSize;
    }

    public List<String> getSortKey(){
        return sortKey;
    }

    public void setSortKey(List<String> sortKey){
        this.sortKey=sortKey;
    }

    public SortTypeEnum getSortType(){
        return sortType;
    }

    public void setSortType(SortTypeEnum sortType){
        this.sortType=sortType;
    }

    @Override
    public Map<String, String> getTextParams() {
        XiniuHashMap txtParams = new XiniuHashMap();
                txtParams.put("id", this.id);
                txtParams.put("name", this.name);
                txtParams.put("weight", this.weight);
                txtParams.put("heat", this.heat);
                txtParams.put("unitheat", this.unitheat);
                txtParams.put("protein", this.protein);
                txtParams.put("fat", this.fat);
                txtParams.put("carbohydrate", this.carbohydrate);
                txtParams.put("df", this.df);
                txtParams.put("barCode", this.barCode);
                txtParams.put("brand", this.brand);
                txtParams.put("foodExchange", this.foodExchange);
                txtParams.put("edubleUnit", this.edubleUnit);
                txtParams.put("unit", this.unit);
                txtParams.put("unitWeight", this.unitWeight);
                txtParams.put("foodLargeCategory", this.foodLargeCategory);
                txtParams.put("foodCategoryId", this.foodCategoryId);
                txtParams.put("isLose", this.isLose);
                txtParams.put("isAddMuscle", this.isAddMuscle);
                txtParams.put("isCommon", this.isCommon);
                txtParams.put("sourceId", this.sourceId);
                txtParams.put("menuId", this.menuId);
                txtParams.put("menuCategory", this.menuCategory);
                txtParams.put("isActive", this.isActive);
                txtParams.put("activeDate", this.activeDate);
                txtParams.put("activeUser", this.activeUser);
                txtParams.put("pageNumber", this.pageNumber);
                txtParams.put("pageSize", this.pageSize);
                if(this.sortKey!=null&&!this.sortKey.isEmpty()){
                    txtParams.put("sortKey", JSON.toJSONString(this.sortKey));
                }
                txtParams.put("sortType", this.sortType);
        if(this.udfParams != null) {
            txtParams.putAll(this.udfParams);
        }
        return txtParams;
    }

    @Override
    public Long getTimestamp() {
    return null;
    }

    @Override
    public void setTimestamp(Long timestamp) {

    }

    @Override
    public Class getResponseClass() {
        return FoodFindResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
                    RequestCheckUtils.checkNotEmpty(pageNumber, "pageNumber");
                    
                    RequestCheckUtils.checkNotEmpty(pageSize,"pageSize");
                    
    }

    @Override
    public Map<String, String> getHeaderMap() {
        return null;
    }

    @Override
    public void putOtherTextParam(String key, String value) {
        this.udfParams.put(key,value);
    }
}